package com.alex.controller;

import com.alex.dto.UserDTO;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/post")
public class PostDemoController {

    @PostMapping("/post1")
    public void post1(@ModelAttribute UserDTO userDTO,
                      @RequestParam String bodyParam,
                      @RequestParam String urlParam) {
        System.out.println(userDTO.toString());
        System.out.println(bodyParam);
        System.out.println(urlParam);
    }

    @PostMapping("/post2")
    public void post2(@RequestBody UserDTO userDTO, @RequestParam String urlParam) {
        System.out.println(userDTO.toString());
        System.out.println(urlParam);
    }
}
